import { fromJS } from 'immutable'
import * as Type from './type'

const defaultState = fromJS({
  login: false
})

export default (state = defaultState, action) => {
  switch(action.type){
    case Type.LOGIN:
      return state.set('login', action.value)
    case Type.LOGINOUT:
      return state.set('login', action.value)
    default:
      return state
  }
}